﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="/themes/portal.css">
	<style type="text/css">
		.title{
			font-size:16px;
			font-weight:bold;
			padding:20px 10px;
			background:#eee;
			overflow:hidden;
			border-bottom:1px solid #ccc;
		}
		.t-list{
			padding:5px;
		}
	</style>
     <script src="/Scripts/szjt-core.js" type="text/javascript"></script>
	<script type="text/javascript" src="/Scripts/jquery.portal.js"></script>
    <script src="../Scripts/szjt-constants.js" type="text/javascript"></script>
    <script src="../Scripts/szjt-constants.message.js" type="text/javascript"></script>
	<script>
	    var Page = {
	        InitPortal: function () {
	            $('#pp').portal({
	                border: false,
	                fit: true
	            });
	        },
	        InitUser: function () {
	            var userInfo = Session.LoginUser();
	            $("#_spanName").text(userInfo.UserName);
	            $("#_spanOrg").text(userInfo.DeptName);
	        },
	        InitTasks: function () {
	            var taskText = dataService.transformData(SysConstant.TaskGuid.MsgInfo, SysConstant.MsgInfo.PendingMessageList.Template);
	            //var taskList = $(utility.xml.convertXmlStringToDoc(taskText));
	            $("#pendingTasks").datagrid({
	                singleSelect: true,
	                rownumbers: true,
	                columns: [[
                    { field: 'Guid', title: 'GUID', hidden: true },
                    { field: 'URL', title: 'URL', hidden: true },
                    { field: 'DataGuid', title: 'DataGuid', hidden: true },
                    { field: 'DataType', title: 'DataType', hidden: true },
                    { field: 'Description', title: "事项描述", width: 500,
                        styler: function (value, rowData, rowIndex) {
                            return 'color:blue;cursor:pointer';
                        }
                    },
                    { field: 'DataStatus', title: '事项状态', width: 100 },
                    { field: 'Priority', title: '优先级', width: 60, hidden: true },
                    { field: 'AuthorName', title: '发起人', width: 100 },
                    { field: 'StartTime', title: '发起时间', width: 150 }
                ]],
	                onClickCell: function (rowIndex, field, value) {
	                    if (field == "Description") {
	                        var rowData = $(this).datagrid("getRows")[rowIndex];
	                        //alert(field + "," + value);
	                        //alert(rowData.URL);
	                        var title = "";
	                        var data = {};
	                        if (rowData.DataType == PrjConstant.AssetMgt.UserApplication.DataType) {
	                            title = "审批阅办";
	                            data = { ApplicationGuid: rowData.DataGuid, MessagGuid: rowData.Guid }
	                        }
	                        utility.page.addMainTab(title, rowData.URL, {}, { actionCode: "", selectedList: data });
	                    }
	                }
	            });
	            $("#pendingTasks").detailgrid("loadXmlString", { xml: taskText, totalNode: "", dataNode: "MessageInfo" });
	        }
	    };
	    $(function () {
	        Page.InitPortal();
	        Page.InitUser();
	        Page.InitTasks();

	        //add();
	    });
	    function add() {
	        for (var i = 0; i < 3; i++) {
	            var p = $('<div/>').appendTo('body');
	            p.panel({
	                title: 'Title' + i,
	                content: '<div style="padding:5px;">Content' + (i + 1) + '</div>',
	                height: 100,
	                closable: true,
	                collapsible: true
	            });
	            $('#pp').portal('add', {
	                panel: p,
	                columnIndex: i
	            });
	        }
	        $('#pp').portal('resize');
	    }
	    function remove() {
	        $('#pp').portal('remove', $('#pgrid'));
	        $('#pp').portal('resize');
	    }
	</script>
</head>
<body class="easyui-layout">
	<div region="center" border="false">
		<div id="pp" style="position:relative">
			<div style="width:30%;">
				<div title="用户信息" style="text-align:left;background:#f3eeaf;height:150px;padding:5px;">
                 <ul>
                <li style="margin-top:10px;">
                    <img src="/Images/index_logo_st.gif" />&nbsp;当前用户：[ <span id="_spanName"></span> ]</li>

                <li style="margin-top:10px;"><img src="../Images/index_logo_tm.gif" />&nbsp;所属部门：[ <span id="_spanOrg"></span> ]</li>
                <li style="text-decoration:uderline; color:Blue;margin-top:10px;"><a id="_setInfo" href="#">[ 修改密码 ]</a></li>
            </ul>
			    </div>
			    <div title="友情链接" collapsible="true" closable="true" style="height:200px;padding:5px;">
<!--			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/datagrid/datagrid1.php">Build border layout for Web Pages</a></div>
			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/layout/panel.php">Complex layout on Panel</a></div>
			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/layout/accordion.php">Create Accordion</a></div>
			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/layout/tabs.php">Create Tabs</a></div>
			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/layout/tabs2.php">Dynamically add tabs</a></div>
			    	<div class="t-list"><a href="http://www.jeasyui.com/tutorial/layout/panel2.php">Create XP style left panel</a></div>-->
			    </div>
			</div>
			<div style="width:40%;">
				<div id="pgrid" title="代办事宜" closable="true" style="height:200px;">
					<table id="pendingTasks">
					</table>
				</div>
			</div>
			<div style="width:30%;">
				<div title="系统通知" closable="true" style="height:80px;padding:10px;">
	
				</div>
			</div>
		</div>
	</div>
</body>
</html>